<?php
include 'sql.php';
$proposal_id=$_POST['proposal_id'];
// $proposal_id=1;

if($proposal_id!='')
{//接收到点赞
          //连接数据库：
            
	$sql="select * from  proposal_main where ID='$proposal_id'";
    $arr=SQL_query($sql);  
    $arr=mysql_fetch_array($arr);
    $praise=$arr['praise'];
    $praise++;
          //根据proposal_id加赞：
    $sql="update proposal_main set praise='$praise' where ID='$proposal_id'";
    $arr=SQL_query($sql);  
        //获得现在总赞数：
    $now_praise_num=$praise;
    $data=array('now_praise_num'=>$now_praise_num);
    
/*        $arr1=array("name"=>"yang","age"=>$arr[0]);
        $arr2=array("name"=>$rows,"age"=>$num);
        $arr3=array("name"=>"zhou","age"=>35);
        $titles=array("title"=>array($arr1,$arr2,$arr3));*/
    echo json_encode($data);
}

?>